<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.beaut.project.util.FlowUtility"%>
<%@ include file="/public/header.jsp"%>

<html>
<head>
<title>工单费用统计</title>
</head>
<script type="text/javascript">
		$(function(){
			$("#searchValue").keypress(function(e) { 
		    	// 回车键事件 
		     	if(e.which == 13) { 
		     		 doSearch();
		       	} 
		   	}); 
			$("#dept_id").combotree({
				url:'<%=contextPath %>/springMVC/group/listDepartment',
				method:'POST',
				animate:true,
				lines:true,
				onChange:function(){
					doSearch();
				}
			});
			
			$("#table").datagrid({
				title:"工单费用统计(审核过的工单才会显示)",
				iconCls:'icon-edit',
				loadMsg:'正在加载数据，请稍后......',
				url:'<%=contextPath%>/springMVC/gd/listPageGDStatisticDetail',
				rownumbers:true,
				singleSelect:true,
				fitColumns:true,
				nowrap:false,
				columns:[[
					{title:'工单进度',field:'gd_status_desc',width:100,align:'center'},
					{title:'所属部门',field:'dept_name',width:100,align:'center'},
					{title:'工单编号',field:'gd_code',width:100,align:'center'},
					{title:'工单名称',field:'gd_name',width:100,align:'center'},
					{title:'工单负责人',field:'gd_admin_name',width:100,align:'center'},
					{title:'实施单位',field:'gd_worker_name',width:100,align:'center'},
					{title:'实施负责人',field:'gd_worker_person',width:100,align:'center'},
					{title:'归属项目编号',field:'xm_code',width:100,align:'center'},
					{title:'归属项目名称',field:'xm_name',width:100,align:'center'},
					{title:'预算分包费',field:'assume_worker_fee',width:100,align:'center'},
					{title:'预算材料费',field:'assume_material_fee',width:100,align:'center'},
					{title:'施工支出',field:'worker_fee',width:100,align:'center'},
					{title:'材料支出',field:'material_fee',width:100,align:'center'},
					{title:'其他支出',field:'other_fee',width:100,align:'center'}
				]],
				toolbar:"#tb",
				pageSize:5,
				pageList : [5,50,100],  
				pagination:true,
				onLoadSuccess:function(rtJson){
					if(rtJson.rtState== '1')
					{
						$.messager.alert('提示',rtJson.rtMsrg);
					}
				}
			});
		});

	function doSearch() {
		var searchValue = $('#searchValue').val();
		var dept_id = $("#dept_id").combotree('getValue');
		$('#table').datagrid('load', {
			searchValue : searchValue,
			dept_id : dept_id
		});
	}
	function exportExcel()
		{
			var searchValue = $('#searchValue').val();
			var dept_id = $("#dept_id").combotree('getValue');
			window.open('<%=contextPath%>/springMVC/excel/gdStatisticDetailExcel?searchValue='+searchValue+'&dept_id='+dept_id);
		}
</script>
<body style="height: 97%">
	<div id="table" data-options="fit:true"></div>
	<div id="tb" style="padding:3px;height:auto">
		<div align="right">
			所属部门：<input  id="dept_id" name="dept_id" class="easyui-combotree">&nbsp;&nbsp; 
			工单编号/名称：<input id="searchValue" name="searchValue" style="width:150px" title="工单编号/名称" placeholder="工单编号/名称 "/>&nbsp;&nbsp; 
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="doSearch();"></a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-excel',plain:true" onclick="exportExcel();"></a>
		</div>
	</div>
</body>
</html>
